package com.cjh.consumer;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class HelloConsumer {

    @RabbitListener(queuesToDeclare = {@Queue("hello")})
    public void receive1(String message) {
        System.out.println("接收到消息:" + message);
    }
}